package com.jt.tenant.widget;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;

import com.jt.tenant.activity.ScannerActivity;
import com.jt.tenant.app.JTApplication;
import com.module.zxing.widget.QRCodeView;

/**
 * Created by Administrator on 2016/2/5.
 */
public class CodeView extends QRCodeView {

    public CodeView(Context context, AttributeSet attrs) {

        super(context, attrs);

    }

    @Override
    protected int marginTop() {

        return JTApplication.ScaleScreenHelper.getWidthHeight(20);

    }

    @Override
    protected int scanWidth() {

        return JTApplication.ScaleScreenHelper.getWidthHeight(559);

    }

    @Override
    protected int scanHeight() {

        return JTApplication.ScaleScreenHelper.getWidthHeight(572);

    }

    @Override
    protected int marginColor() {

        return Color.parseColor("#f8f8f8");

    }

    @Override
    protected void onResult(String result) {

        if(ScannerActivity.bindLinstener != null){

            ScannerActivity.bindLinstener.bind(result);

        }

    }

}
